@W-19014904 – Adyen Apple Pay PDP#2787
@W-19014904 – Adyen Apple Pay PDP#2787mmccullom-sf merged 26 commits intoSalesforceCommerceCloud:adyenExpressPaymentsDreamForcefrom
Conversation
|
Thanks for the contribution! Unfortunately we can't verify the commit author(s): mmccullom <m***@s***.com>. One possible solution is to add that email to your GitHub account. Alternatively you can change your commits to another email and force push the change. After getting your commits associated with your GitHub account, refresh the status of this Pull Request. |
🎉 Snyk checks have passed. No issues have been found so far.✅ security/snyk check is complete. No issues have been found. (View Details) ✅ license/snyk check is complete. No issues have been found. (View Details) |
Signed-off-by: mmccullom-sf <mmccullom+@salesforce.com>
…to adyenApplePayPDP
| */ | ||
| export default async function handler(req, res) { | ||
| if (req.method !== 'GET') { | ||
| return res.status(405).json({error: 'Method not allowed'}) |
There was a problem hiding this comment.
These aren't shopper facing error messages right?
There was a problem hiding this comment.
They're API error messages, so if for whatever reason someone tried to hit this API with postman or something and had an invalid method they would see these errors.
packages/template-retail-react-app/app/api/adyen/paymentMethods/standalone.js
Outdated
Show resolved
Hide resolved
...te-retail-react-app/app/components/apple-pay-express/hooks/use-standalone-payment-methods.js
Outdated
Show resolved
Hide resolved
Signed-off-by: mmccullom-sf <mmccullom+@salesforce.com>
| regularAdyenData.adyenEnvironment | ||
|
|
||
| const adyenPaymentMethods = usingStandalone ? standalonePaymentMethods : regularAdyenData.adyenPaymentMethods | ||
| const basket = regularAdyenData.basket |
There was a problem hiding this comment.
Probably an area for more testing like you mentioned, but do you know if this is going to return the right basket every time?
I believe regularAdyenData.basket is coming from the useCurrentBasket() hook. This gets all customer baskets and returns the first if no basketId was specified:
const currentBasket = basketsData?.baskets?.find((basket) => basket?.basketId === id) || basketsData?.baskets?.[0]
cleanupTemporaryBasket() should take care of this though is the thought?
There was a problem hiding this comment.
You're right actually good catch, I think this could depend on a race condition where the API response timing could decide which basket gets chosen, I'll fix it to guarantee we're getting the temporary basket if it's PDP.
|
|
||
| applePayAmount = currentBasket.orderTotal || currentBasket.productTotal || 0 | ||
|
|
||
| // CRITICAL: Force final order calculation before payment |
There was a problem hiding this comment.
Let's update the tests to cover these scenarios.
There was a problem hiding this comment.
Can we do this in a follow up PR?
| getToken() | ||
| }, []) | ||
|
|
||
| // PostMessage listener for SKU updates |
There was a problem hiding this comment.
Since the MIAW side changes are going into the develop branch, when will those be merged into main?
Since we're not releasing ApplePay on PDP for the July 31st release, I'm wondering if this should be in a separate branch and merge it into adyenApplePayBranch3 when the MIAW side changes are also merged into its main branch.
Also, are we defaulting isPdpMode=false and do we have sufficient null checks in place for ApplePay in Checkout to work without the MIAW changes?
There was a problem hiding this comment.
We've solved the prior issues, but to focus on your second question, yes, even without MIAW changes checkout will still function as per usual.
| navigate={navigate} | ||
| > | ||
| <ApplePayExpress /> | ||
| <ApplePayExpress sku={currentSku} quantity={currentQuantity} isPdpMode={isPdpMode} /> |
There was a problem hiding this comment.
To reduce the number of params, we could wrap them in an object like pdpData.
Signed-off-by: mmccullom-sf <mmccullom+@salesforce.com>
2b7eebf
into
SalesforceCommerceCloud:adyenExpressPaymentsDreamForce
Description
Adding Apple Pay to the PDP page of the agent.
Types of Changes
Changes
How to Test-Drive This PR
Checklists
General
Accessibility Compliance
You must check off all items in one of the follow two lists:
or...
Localization